package cn.iune.erp.invoice;

import java.math.BigDecimal;
import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

@Entity
@Table(name = "AccountInvoiceDetail")
@NamedQuery(name="AccountInvoiceDetail.findAll", query="SELECT s FROM AccountInvoiceDetail s")
public class AccountInvoiceDetail {

	@Id
	@Column(length=36)
	private String fID;
	
	@Column(length=32)
	private String systemCode;
	@Column(length=4)
	private String billType;
	@Column(length=20)
	private String billTypeName;
	private Date orderDate;
	@Column(length=10)
	private String state = "active";
	@Column(length=10)
	private String status = "open";
	@Column(length=10)
	private String audit = "active";

	@Column(length=1)
	private String revOpay;
	private int direction = 0;
	private Date confirmDate;
	
	@Column(length=4)
	private String origin;
	@Column(length=20)
	private String originName;
	@Column(length=20)
	private String originNo;
	@Column(length=5)
	private String originSerialNo;

	@Column(length=5)
	private String serialNo;
	
	@Column(length=20)
	private String accountInvoiceNo;
	@Column(length=32)
	private String fMasterID;
	
	@Column(length=1)
	private String invoiceCategory;
	@Column(length=20)
	private String invoiceCategoryLabel;
	
	@Column(length=32)
	private String captionID;//科目编码
	@Column(length=10)
	private String captionNo;
	@Column(length=50)
	private String captionName;
	@Column(length=256)
	private String captionFullName;//科目名称
	
	@Column(length=3)
	private String dealObject;
	@Column(length=20)
	private String dealObjectLabel;
	@Column(length=32)
	private String customerID;
	@Column(length=15)
	private String customerNo;
	@Column(length=20)
	private String shortName;
	@Column(length=128)
	private String customerName;

	private int taxType = 0;
	@Column(length=10)
	private String taxTypeLabel;
	@Column(precision=10,scale=2)
	private BigDecimal taxRate = BigDecimal.ZERO;
	
	@Column(length=32,nullable=true)
	private String sbomID;//销售BOM（成套出售时使用）
	private int lv = 0;//主件：0，元件：1
	private int sttts = 1;//是否参加数量和金额的统计。不参加：0，参加：1
	private int checkin = 1;//是否参加出入库登记（影响单据总数量）。不参加（不计入单据总数量）：0，参加：1
	
	@Column(length=32)
	private String itemID;//收入类型ID（其他应收应付单）
	@Column(length=30)
	private String itemNo;//收入类型（其他应收应付单）
	@Column(length=100)
	private String itemName;
	@Column(length=512)
	private String itemProperty;//收入项目（其他应收应付单）
	@Transient
	private String itemDescribe;
	@Column(length=15)
	private String unitCode;
	@Column(length=20)
	private String unitName;
	
	///////////////////////////////////////////////////////////////////////////////
//	@Column(length=32)
//	private String factoryID;
//	@Column(length=15)
//	private String factoryNo;
//	@Column(length=20)
//	private String factoryName;
	
//	@Column(length=3)
//	private String storageType;
//	@Column(length=20)
//	private String storageTypeLabel;
//	@Column(length=65)
//	private String storageID;
//	@Column(length=32)
//	private String storageNo;
//	@Column(length=20)
//	private String storageName;
//	@Column(length=128)
//	private String floorNo;
	
	@Column(precision=38,scale=2)
	private BigDecimal costingAmount = BigDecimal.ZERO;

	@Column(precision=38,scale=6)
	private BigDecimal costingAmountPer = BigDecimal.ZERO;
	/////////////////////////////////////////////////////////////////////////////////
	
	private Date predictStart;//资产借出开始时间
	private Date predictEnd;//资产借出结束时间

	@Column(length=20)
	private String fPhone;
	
	@Column(precision=38,scale=6)
	private BigDecimal itemPrice = BigDecimal.ZERO;
	@Column(precision=10,scale=2)
	private BigDecimal discountRate = BigDecimal.ONE;
	
	//整单折扣（额），与上面的折扣率没有关系
	@Column(precision=38,scale=2,columnDefinition="DECIMAL(38,2) default 0")
	private BigDecimal discountAmount = BigDecimal.ZERO;//整单折扣//扣款金额

	@Column(precision=10,scale=2)
	private BigDecimal itemAmount = BigDecimal.ZERO;
	@Column(precision=38,scale=2)
	private BigDecimal orderAmount = BigDecimal.ZERO;

	@Column(precision=38,scale=2)
	private BigDecimal orderAmountOld = BigDecimal.ZERO;
	@Column(precision=38,scale=2)
	private BigDecimal orderAmountTax = BigDecimal.ZERO;
	@Column(precision=38,scale=2)
	private BigDecimal orderAmountTotal = BigDecimal.ZERO;
	
	private Date billDate;
	@Column(precision=38,scale=6)
	private BigDecimal dealPrice = BigDecimal.ZERO;

	@Column(length=15)
	private String orderNo;
	@Column(length=15)
	private String projectNo;
	
	@Column(precision=10,scale=2)
	private BigDecimal evaluateQuantityRinse = BigDecimal.ZERO;//暂估回冲数量
	@Column(precision=38,scale=2)
	private BigDecimal evaluateAmountRinse = BigDecimal.ZERO;//暂估回冲金额

	@Column(length=20)
	private String resultStatus = "待审核";

//	@Column(length=15)
//	private String departmentNo;
//	@Column(length=256)
//	private String departmentName;
	@Column(length=256)
	private String employeeNo;
	@Column(length=256)
	private String employeeName;

	@Column(length=255)
	private String comments;
	
	@Column(length=65)
	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	@Column(length=128)
	private String enterpriseName;

	@Version
	private int version = 0;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}


	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
	
	
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}


	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getTaxTypeLabel() {
		return taxTypeLabel;
	}

	public void setTaxTypeLabel(String taxTypeLabel) {
		this.taxTypeLabel = taxTypeLabel;
	}

	public BigDecimal getItemPrice() {
		return itemPrice;
	}

	public void setItemPrice(BigDecimal itemPrice) {
		this.itemPrice = itemPrice;
	}

	public BigDecimal getEvaluateQuantityRinse() {
		return evaluateQuantityRinse;
	}

	public void setEvaluateQuantityRinse(BigDecimal evaluateQuantityRinse) {
		this.evaluateQuantityRinse = evaluateQuantityRinse;
	}

	public BigDecimal getEvaluateAmountRinse() {
		return evaluateAmountRinse;
	}

	public void setEvaluateAmountRinse(BigDecimal evaluateAmountRinse) {
		this.evaluateAmountRinse = evaluateAmountRinse;
	}

	public String getDealObjectLabel() {
		return dealObjectLabel;
	}

	public void setDealObjectLabel(String dealObjectLabel) {
		this.dealObjectLabel = dealObjectLabel;
	}

	public int getTaxType() {
		return taxType;
	}

	public void setTaxType(int taxType) {
		this.taxType = taxType;
	}

	public BigDecimal getTaxRate() {
		return taxRate;
	}

	public void setTaxRate(BigDecimal taxRate) {
		this.taxRate = taxRate;
	}

	public BigDecimal getDealPrice() {
		return dealPrice;
	}

	public void setDealPrice(BigDecimal dealPrice) {
		this.dealPrice = dealPrice;
	}

	public String getBillTypeName() {
		return billTypeName;
	}

	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}

	public String getOriginName() {
		return originName;
	}

	public void setOriginName(String originName) {
		this.originName = originName;
	}


	public String getCaptionID() {
		return captionID;
	}
	public void setCaptionID(String captionID) {
		this.captionID = captionID;
	}
	public String getCaptionNo() {
		return captionNo;
	}
	public void setCaptionNo(String captionNo) {
		this.captionNo = captionNo;
	}
	public String getCaptionName() {
		return captionName;
	}
	public void setCaptionName(String captionName) {
		this.captionName = captionName;
	}
	public String getCaptionFullName() {
		return captionFullName;
	}

	public void setCaptionFullName(String captionFullName) {
		this.captionFullName = captionFullName;
	}

	public String getRevOpay() {
		return revOpay;
	}

	public void setRevOpay(String revOpay) {
		this.revOpay = revOpay;
	}

	public String getfID() {
		return fID;
	}

	public void setfID(String fID) {
		this.fID = fID;
	}
	
	public String getSystemCode() {
		return systemCode;
	}

	public void setSystemCode(String systemCode) {
		this.systemCode = systemCode;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getAudit() {
		return audit;
	}

	public void setAudit(String audit) {
		this.audit = audit;
	}

	public Date getConfirmDate() {
		return confirmDate;
	}

	public void setConfirmDate(Date confirmDate) {
		this.confirmDate = confirmDate;
	}

	public String getBillType() {
		return billType;
	}
	public void setBillType(String billType) {
		this.billType = billType;
	}
	public String getProjectNo() {
		return projectNo;
	}
	public void setProjectNo(String projectNo) {
		this.projectNo = projectNo;
	}
	public String getItemNo() {
		return itemNo;
	}
	public void setItemNo(String itemNo) {
		this.itemNo = itemNo;
	}
	public String getItemDescribe() {
		return itemDescribe;
	}
	public void setItemDescribe(String itemDescribe) {
		this.itemDescribe = itemDescribe;
	}
	public String getUnitCode() {
		return unitCode;
	}
	public void setUnitCode(String unitCode) {
		this.unitCode = unitCode;
	}
	public String getUnitName() {
		return unitName;
	}
	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}
	public BigDecimal getItemAmount() {
		return itemAmount;
	}

	public void setItemAmount(BigDecimal itemAmount) {
		this.itemAmount = itemAmount;
	}

	public BigDecimal getOrderAmount() {
		return orderAmount;
	}
	public void setOrderAmount(BigDecimal orderAmount) {
		this.orderAmount = orderAmount;
	}
	public BigDecimal getOrderAmountOld() {
		return orderAmountOld;
	}
	public void setOrderAmountOld(BigDecimal orderAmountOld) {
		this.orderAmountOld = orderAmountOld;
	}
	public BigDecimal getOrderAmountTax() {
		return orderAmountTax;
	}
	public void setOrderAmountTax(BigDecimal orderAmountTax) {
		this.orderAmountTax = orderAmountTax;
	}
	public String getOrigin() {
		return origin;
	}
	public void setOrigin(String origin) {
		this.origin = origin;
	}

	public String getOriginNo() {
		return originNo;
	}
	public void setOriginNo(String originNo) {
		this.originNo = originNo;
	}
	public String getEnterpriseNo() {
		return enterpriseNo;
	}
	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}
	public String getEnterpriseName() {
		return enterpriseName;
	}
	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}
	public int getDirection() {
		return direction;
	}

	public void setDirection(int direction) {
		this.direction = direction;
	}

	public BigDecimal getOrderAmountTotal() {
		return orderAmountTotal;
	}
	public void setOrderAmountTotal(BigDecimal orderAmountTotal) {
		this.orderAmountTotal = orderAmountTotal;
	}
	public String getfMasterID() {
		return fMasterID;
	}
	public void setfMasterID(String fMasterID) {
		this.fMasterID = fMasterID;
	}

	public String getAccountInvoiceNo() {
		return accountInvoiceNo;
	}

	public void setAccountInvoiceNo(String accountInvoiceNo) {
		this.accountInvoiceNo = accountInvoiceNo;
	}

	public String getDealObject() {
		return dealObject;
	}

	public void setDealObject(String dealObject) {
		this.dealObject = dealObject;
	}

	public String getCustomerNo() {
		return customerNo;
	}

	public void setCustomerNo(String customerNo) {
		this.customerNo = customerNo;
	}

	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	public Date getBillDate() {
		return billDate;
	}

	public void setBillDate(Date billDate) {
		this.billDate = billDate;
	}

	public String getEmployeeNo() {
		return employeeNo;
	}

	public void setEmployeeNo(String employeeNo) {
		this.employeeNo = employeeNo;
	}

	public String getEmployeeName() {
		return employeeName;
	}

	public void setEmployeeName(String employeeName) {
		this.employeeName = employeeName;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getCustomerID() {
		return customerID;
	}
	public void setCustomerID(String customerID) {
		this.customerID = customerID;
	}
	public String getItemID() {
		return itemID;
	}
	public void setItemID(String itemID) {
		this.itemID = itemID;
	}
	public String getItemProperty() {
		return itemProperty;
	}
	public void setItemProperty(String itemProperty) {
		this.itemProperty = itemProperty;
	}
	public BigDecimal getDiscountRate() {
		return discountRate;
	}
	public void setDiscountRate(BigDecimal discountRate) {
		this.discountRate = discountRate;
	}
	public String getOrderNo() {
		return orderNo;
	}
	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	public String getResultStatus() {
		return resultStatus;
	}
	public void setResultStatus(String resultStatus) {
		this.resultStatus = resultStatus;
	}

	public String getItemName() {
		return itemName;
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	public Date getPredictStart() {
		return predictStart;
	}
	public void setPredictStart(Date predictStart) {
		this.predictStart = predictStart;
	}
	public Date getPredictEnd() {
		return predictEnd;
	}
	public void setPredictEnd(Date predictEnd) {
		this.predictEnd = predictEnd;
	}
	public String getfPhone() {
		return fPhone;
	}
	public void setfPhone(String fPhone) {
		this.fPhone = fPhone;
	}
	public String getSbomID() {
		return sbomID;
	}
	public void setSbomID(String sbomID) {
		this.sbomID = sbomID;
	}
	public int getLv() {
		return lv;
	}
	public void setLv(int lv) {
		this.lv = lv;
	}
	public int getSttts() {
		return sttts;
	}
	public void setSttts(int sttts) {
		this.sttts = sttts;
	}
	public BigDecimal getCostingAmount() {
		return costingAmount;
	}
	public void setCostingAmount(BigDecimal costingAmount) {
		this.costingAmount = costingAmount;
	}
	public BigDecimal getCostingAmountPer() {
		return costingAmountPer;
	}
	public void setCostingAmountPer(BigDecimal costingAmountPer) {
		this.costingAmountPer = costingAmountPer;
	}
	public int getCheckin() {
		return checkin;
	}
	public void setCheckin(int checkin) {
		this.checkin = checkin;
	}
	public String getOriginSerialNo() {
		return originSerialNo;
	}
	public void setOriginSerialNo(String originSerialNo) {
		this.originSerialNo = originSerialNo;
	}
	public String getSerialNo() {
		return serialNo;
	}
	public void setSerialNo(String serialNo) {
		this.serialNo = serialNo;
	}
	public BigDecimal getDiscountAmount() {
		return discountAmount;
	}
	public void setDiscountAmount(BigDecimal discountAmount) {
		this.discountAmount = discountAmount;
	}
	public String getInvoiceCategory() {
		return invoiceCategory;
	}
	public void setInvoiceCategory(String invoiceCategory) {
		this.invoiceCategory = invoiceCategory;
	}
	public String getInvoiceCategoryLabel() {
		return invoiceCategoryLabel;
	}
	public void setInvoiceCategoryLabel(String invoiceCategoryLabel) {
		this.invoiceCategoryLabel = invoiceCategoryLabel;
	}
	
	
	
	
}

